﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CommonTagTime.ModelObject;
using CommonTagTime;
using System.IO;
using CommonTagTime.Business;
public partial class ucBannerLeft : System.Web.UI.UserControl
{
    public LogoCollection lstLogo = new LogoCollection();
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadData();
    }

    private void LoadData()
    {
        busLogo objBusLogo=new busLogo();
        lstLogo = objBusLogo.GetByPosition((byte)enmTemplatePosition.Left);
    }
    public string CreateIamge(string image)
    {

        return "/" + clsConfigData.DEFAULT_UPLOAD_LOGO_FOLDER + image;
       
       
    }
    public string CreateLink(string link)
    {
        if (link == string.Empty)
            return "javascript:void(0);";
        if (link.Contains("http://"))
            return link;
        else return "http://" + link;
    }
    public bool CheckLogoisExists(string image)
    { 
          string imagePage = "~/" + clsConfigData.DEFAULT_UPLOAD_LOGO_FOLDER + image;
          if (File.Exists(this.Page.Server.MapPath(imagePage)))
              return true;
          return false;
    }
}

